int buttonOn = 9;
int buttonOff = 10;
int ledPin = 11;
int Time = 1000; 
int value = 0;
void setup() {
  // put your setup code here, to run once:
  pinMode(buttonOn,INPUT);
  pinMode(buttonOff,INPUT);
  pinMode(ledPin,OUTPUT);
 // digitalWrite(ledPin,HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:
  int On = digitalRead(buttonOn);
  int Off = digitalRead(buttonOff);

  if(On==HIGH&&(millis()-Time)>4000)
    OnLight(5);

  if(Off==HIGH&&(millis()-Time)>4000)
    OffLight(5);
}
void OnLight(byte increament){
  value+=increament;
    analogWrite(ledPin,value);
    delay(Time/(255/5));
  
}
void OffLight(byte decreament){
  value-=decreament;
    analogWrite(ledPin,value);
    delay(Time/(255/5));
  
}
